home *** CD-ROM | disk | FTP | other *** search
/ Deutsche Edition 1 / Deutsche Edition 1.iso / libs / xprkermit.doc < prev    next >
Text File  |  1993-11-04  |  18KB  |  381 lines

  1.                               XPR Kermit
  2.                          Version 1.111 - RELEASE
  3.                            December 21, 1991
  4.  
  5.                      Marco Papa - Felsina Software
  6.                 Stephen R. Walton, Cal State Northridge
  7.  
  8. This is an implentation of an External Protocol (XPR) library for the
  9. Kermit file transfer protocol.  In keeping with the Kermit documents,
  10. here is a list of the items supported and not supported.
  11.  
  12. XPR Kermit Capabilities At A Glance:
  13.  
  14.   Local operation:                   Yes
  15.   Remote operation:                  No
  16.   Login scripts:                     *
  17.   Transfer text files:               Yes
  18.   Transfer binary files:             Yes
  19.   Wildcard send:                     Yes
  20.   File transfer interruption:        Yes
  21.   Filename collision avoidance:      No
  22.   Can time out:                      Yes
  23.   8th-bit prefixing:                 Yes
  24.   Repeat count prefixing:            Yes
  25.   Alternate block checks:            Yes
  26.   Terminal emulation:                *
  27.   Communication settings:            Yes
  28.   Transmit BREAK:                    *
  29.   Support for dialout modems:        *
  30.   IBM mainframe communication:       *
  31.   Transaction logging:               No
  32.   Session logging (raw download):    No
  33.   Debug logging:                     No
  34.   Packet logging:                    No
  35.   Act as server:                     No
  36.   Talk to server:                    Yes
  37.   Advanced server functions:         No
  38.   Local file management:             *
  39.   Command/Init files:                *
  40.   UUCP and multiuser line locking:   *
  41.   Long packets:                      Yes
  42.   Sliding Windows:                   No
  43.   File attributes packets:           No
  44.   Command macros:                    *
  45.   Raw file transmit:                 *
  46.  
  47. The items marked with a '*' above are those which are to be provided by the
  48. calling terminal emulation program.  Notice that, although XPR Kermit itself
  49. cannot be a "Kermit server," often the communcation program's scripting
  50. capability will allow XPR Kermit to be used for the unattended transfer
  51. of files between the Amiga and a remote machine.
  52.  
  53. I. Introduction
  54. ---------------
  55.  
  56. XPR Kermit implements the Kermit file transfer protocol in the form of an
  57. Amiga External Protocol (XPR) library.  This allows the addition of an
  58. up-to-date version of the Kermit protocol to any communications program
  59. which supports the XPR specification.  For further information on Kermit,
  60. read the book "Kermit:  A File Transfer Protocol" by Frank da Cruz, 1986,
  61. Digital Press.
  62.  
  63. To install XPR Kermit, simply copy the file "xprkermit.library" to your
  64. LIBS: directory, and request your comm program to use XPRKERMIT as its
  65. external file transfer protocol.
  66.  
  67. XPR Kermit supports Version 2.0 of the XPR Protocol specification.  For
  68. more details on this, I recommend that you find a copy of the XPR Zmodem
  69. library, version 2.0.  Its documentation contains a good deal of the
  70. justification and philosophy of external protocol libraries, which I
  71. won't repeat here.
  72.  
  73. Please note that this document assumes you already have some
  74. understanding of what the Kermit protocol is, and how to use it.  I
  75. have tried to include a few hints about common problems, but there is
  76. no substitute for obtaining and using a copy of the documentation for
  77. the Kermit on the other system to which you will be talking.  In
  78. addition, two commercial books are available.  "Kermit:  A File
  79. Transfer Protocol" by Frank da Cruz describes the protocol in some
  80. detail.  While aimed at those writing a Kermit program, it contains a
  81. good deal of useful information about Kermit itself.  "MS-DOS Kermit"
  82. by Christine Gianone is, despite its title, a wealth of good
  83. introductory information about any version of Kermit.
  84.  
  85. II. Setting Options
  86. -------------------
  87.  
  88. XPR Kermit supports the parts of the Kermit protocol outlined in the table
  89. above.  There are currently seven user-settable parameters in XPR Kermit,
  90. which cover the parameters which are most often necessary to customize.
  91. If your communications problem is especially severe--for example, your
  92. method of connection to another system swallows characters which are special
  93. to Kermit, such as '#' or '&'--you may need to get a copy of the stand-alone
  94. Kermit program, C Kermit for the Amiga, distributed via many paths.
  95.  
  96. There are actually two sets of "setup" parameters in XPR Kermit.  The first
  97. set are commands which XPR Kermit can send to a remote Kermit server. These
  98. are not actually setups, but are in fact commands to XPR Kermit which cause it
  99. to communicate with a remote Kermit server.  The fourth command in this group
  100. is "Change Options," which causes no communication.  Instead, you are
  101. requested for changes in the current values of the parameters which Kermit
  102. will use for communication.
  103.  
  104. These items can be set in one of two ways.  One method is with a simple
  105. character string which is sent to XPR Kermit by the comm program;  this string
  106. will hereafter be referred to as the "init string."  This is generally done if
  107. an environment variable named "xprkermit" exists and has a value, in which
  108. case XPR Kermit is sent the value when you first select XPR Kermit as your
  109. protocol.  Some comm programs also allow an initialization string to be sent
  110. in other ways, such as from a script; VLT, for example, has an INITXPR script
  111. command.  The format of this string is specified by the external protocol.
  112.  
  113. The second, more elegant method, is with some type of requester or set
  114. of requesters.  In this case, you will be presented by your comm program
  115. with a set of Intuition gadgets of some type which allow the choice of
  116. XPR Kermit commands and the setting of the options.
  117.  
  118. However, the string method has the advantage of giving one the ability to
  119. change external protocol settings non-interactively, such as from a script. 
  120. In the case of XPR Kermit, such a script can actually command XPR Kermit to
  121. perform communication.  One obvious use of this is to transfer an entire
  122. directory tree from your Amiga to a remote machine:  you can make the remote's
  123. Kermit a server and command it to perform the appropriate CD commands, then
  124. transfer files.
  125.  
  126. The currently supported XPR Kermit server commands are listed below.
  127. The format of the init string is in parentheses, generally simply a
  128. single letter.
  129.  
  130.     Kermit Finish (F):  Tells a Kermit server that you are done.  The
  131.     remote server will stop being a server.
  132.  
  133.     Kermit Bye (B):  Tells a Kermit server that you are done;  the server
  134.     will exit and log you off the remote machine.
  135.  
  136.     Kermit CD (C{dir}):  Change the default directory for files sent or
  137.     received by the Kermit server.  Examples of the init string would
  138.     be 'C/bin' or 'Cuser:[username.amiga]'.
  139.  
  140. For setting options via an init string, the first character of the init
  141. string must be the letter O (for Options).  Following that letter can
  142. be one or more of the option setting formats listed bellow;  these
  143. can be separated by whitespace and/or commas.
  144.  
  145. There are three settings which are either "yes" or "no."  Your comm program
  146. will give you some way of setting them interactively.  Simple button gadgets
  147. will be labeled "yes" and "no;"  otherwise, you may see a string gadget,
  148. into which you should type the word "yes" or "no" by hand.  This string is
  149. case-insensitive.  In the init-string, "yes" is represented by the single
  150. upper-case character Y.
  151.  
  152.     Convert FileName (C{Y|N}):  If "yes," then incoming file names are
  153.     converted to a form acceptable to the Amiga.  Currently, this
  154.     means simply translating them to lower case.  Default "yes."
  155.  
  156.     Host Server (G{Y|N}):  If "yes," then the host (remote) Kermit is
  157.     assumed to be in server mode.  You will be prompted for file
  158.     names when you request an XPR Kermit receive, and this file
  159.     name will be sent to the server in the form of a Kermit GET
  160.     command.  Default "no."
  161.  
  162.     Keep Incomplete (K{Y|N}) If "yes," then incomplete files will be
  163.     kept.  An incomplete file can result from either an actual
  164.     error in the transfer, or a user-requested cancellation of
  165.     a transfer in process.  Default "no."
  166.  
  167.     Text File (T{Y|N}):  Flags whether the incoming file is text or binary.
  168.     If "yes," then carriage-return/line-feed pairs in the incoming
  169.     packets are converted to a single line-feed before writing the
  170.     packet to a file, and the opposite conversion is made when a file
  171.     is sent to a remote system.  Default "yes".
  172.  
  173.     If your communcations program supports its own text/binary flag
  174.     (that is, if the xpr_finfo() function exists and can tell XPR
  175.     Kermit whether a given file is text or binary), this option will
  176.     not appear.
  177.  
  178. Numerical settings are as follows.  Here, the init string key letter should
  179. be followed by a numerical value.
  180.  
  181.     Packet Length (P{length}):  The Long Packets extension to Kermit is
  182.     fully supported. The current limit is 2048 for XPR Kermit;
  183.     the default value is 94, the longest standard Kermit packet.
  184.  
  185.     Block Check (B{type}):  This can have the value of 1, 2, or 3, and
  186.     chooses successively more stringent types of error checking on
  187.     the incoming data:  6-bit checksum, 12-bit checksum, and 16-bit
  188.     CRC, respectively.  Default is 1 (6-bit checksum).
  189.  
  190.     Timeout (O{seconds}):  The length of time the remote Kermit should wait
  191.     for a packet from XPR Kermit before assuming it isn't coming. The
  192.     default is 10 seconds.
  193.     (O is for Out, as in TimeOut;  T is already taken by the Text flag.)
  194.  
  195.      Retry Limit (R{number}):  The number of times XPR Kermit will attempt
  196.     to send or receive the next packet of data before quitting.  Notice
  197.     that if the remote end simply stops sending, a length of time equal
  198.     to the retry limit times the timeout will elapse before XPR Kermit
  199.     actually exits.  Default 5 retries.
  200.  
  201. Setting a packet length larger than 94 (the default) enters long packet
  202. mode automatically.  If you use long packets, it is *strongly*
  203. recommended that you use block check 2 or 3 if the host Kermit supports
  204. them.  In addition, if binary files are to be transmitted, a higher
  205. block check than 1 should be used as well.
  206.  
  207. Timeout settings are a bit confusing, I've found. The timeout set via
  208. XPR Kermit's requester is what standalone Kermit programs normally call
  209. the "receive timeout," and is the length of time which XPR Kermit will
  210. request the other end to wait before assuming that XPR Kermit is not
  211. sending any response to the most recently sent packet.  The "send
  212. timeout" is the length of time XPR Kermit should wait for a packet from
  213. the remote end and is requested by the remote end. It is generally set
  214. at that end by a "set send timeout" command. With long packets at low
  215. baud rates (say, 2048 bytes at 1200 baud), both these times should be
  216. long enough to ensure an entire packet can be transferred in this time.
  217. The symptom if it is too short is that each packet will be sent exactly
  218. twice.
  219.  
  220. These can be mixed and matched.  For instance, to talk to a Kermit server
  221. with 750-byte packets, block check 2, keep incomplete files, binary
  222. files, and a 10-second timeout, the init string could be
  223. "OP750,B2,KY,TN,O10".  Cryptic, but usable.
  224.  
  225. III. Transferring Files
  226. -----------------------
  227.  
  228. Once XPR Kermit is set up, transferring files is as simple as with any
  229. of the protocols built in to your communication program.  Typically, you
  230. will log into a remote computer, start up its Kermit program, and issue
  231. the "send filename" or "receive" command to the remote Kermit.  A
  232. message will be printed, something like "Escape back to your local
  233. system and give a RECEIVE command" if you told the remote to send a
  234. file.  Issue the Receive File command to your terminal program; 
  235. frequently, this is Right-Amiga-R.  Sit back and watch the file be
  236. transferred.
  237.  
  238. The files received by XPR Kermit are placed in the comm program's idea
  239. of its current directory;  that is, XPR Kermit asks the comm program
  240. to create a file of the same name as the file on the sending system,
  241. but leaves the directory in which the creation is to occur up to the
  242. comm program.  For sending files, path information is stripped from
  243. the file name before it is sent to the remote.
  244.  
  245. XPR Kermit supports multiple files on both send and receive.  Multiple
  246. received files are handled by the sending Kermit.  One almost always
  247. issues a wildcard send command, for example "send *.for" to send all
  248. Fortran files.  For sending multiple files, XPR Kermit queries the
  249. calling communication program for the names of the files to send, one at
  250. a time.  Check your program documentation for its method of supporting
  251. this.  Two common possibilities are simply the ability to type a
  252. wildcard into a string requester specifying the files to send, and being
  253. able to check multiple files in a list on a file requester.
  254.  
  255. If the "Host is Server" flag is set on the XPR Kermit options, it is
  256. assumed that you started the remote Kermit and issued the "Server"
  257. command to it.  This modifies XPR Kermit's behavior on receiving files.
  258. Since you can no longer tell the remote host which files to send, XPR
  259. Kermit uses the Kermit GET command instead.  The file to GET is
  260. requested by the comm program when you issue a "Receive File" command.
  261. A string requester is almost always used here to prompt for the files
  262. to receive.  Note that this should be in the format of the *remote*
  263. system, not the Amiga.  This is important for wildcards;  SENDing a
  264. batch of Amiga files will generally use AmigaDOS wildcards (#?.for for
  265. all Fortran files), while a Unix, VAX/VMS, or MS/DOS system would use
  266. *.for for the same operation.
  267.  
  268. XPR Kermit supports three levels of transfer abort, out of the 33 which
  269. can be part of an XPR-supporting comm program.  The lowest level of an
  270. XPR abort is treated by XPR Kermit as a file abort, meaning that, if a
  271. batch transfer is in effect, the current file's transfer is interrupted
  272. but the protocol proceeds with the next file.  This is most useful in a
  273. wildcard transfer, where the wildcard matches a long file which you
  274. don't actually want transferred. The next higher level is treated as a
  275. batch abort, meaning that all files are cancelled.  Both of these
  276. aborts happen in a "graceful" way, which will not generally result in
  277. the remote Kermit exiting with an error status.  The highest level XPR
  278. Kermit abort, which is all many programs provide, is treated as an
  279. immediate stop-dead.  An error packet containing the string "User
  280. cancelled." is sent to the remote Kermit, the same message is echoed on
  281. the comm program status display, and XPR Kermit exits.  In addition, if
  282. the "Keep Incomplete Files" flag is OFF, the most recently received
  283. file will be deleted, if the cancelled transfer was a receive.
  284.  
  285. IV. Future Extensions
  286. ----------------------
  287.  
  288. This is probably the last release of XPR Kermit in its current form. At
  289. some future point, XPR Kermit will, I hope, become an interface to
  290. Columbia University's C Kermit code.  This will allow XPR Kermit to
  291. always contain the latest version of the Kermit protocol, provided that
  292. I or someone writes the required machine-dependent functions. Among
  293. other things, such a rewrite would automatically include both the
  294. sliding windows and attribute packets extensions to the Kermit protocol
  295. into XPR Kermit, since they are in the current version of C Kermit.
  296.  
  297. Incidentally, I (Stephen Walton) am the co-supporter of C Kermit for
  298. the Amiga.  As of this writing, version 5A of this program is in alpha
  299. test.
  300.  
  301. V.  Other information
  302. ----------------------
  303.  
  304. The file "kermitproto.doc" describes the code contained in the file
  305. "kermitproto.w," which actually implements the Kermit protocol.  It is
  306. somewhat out of data, and "kermitproto.w" is pretty XPR Kermit-specific
  307. at this point (it was originally intended as a small, stand-alone
  308. Kermit implementation in C).
  309.  
  310. VI.  Credits
  311. -----------
  312.  
  313. The following people had a hand in this code.  In chronological order,
  314. they are:
  315.  
  316. -- Frank DaCruz of Columbia University, who wrote the original code and
  317.    published it in his book.
  318. -- Steve Walton of Cal State Northridge, who got Frank's code actually
  319.    working in the form of the original "kermitproto.w" module.
  320. -- Marco Papa of Felsina Software, for the first beta XPR version
  321. -- Steve Walton, for second and subsequent XPR Kermit's.
  322.  
  323. Other acknowledgements go to Willy Langeveld for developing the XPR
  324. spec, and to Rick Huebner, several of whose ideas in XPR Zmodem were
  325. taken over into XPR Kermit by Steve Walton. Thank you all! 
  326.  
  327. VI.  Gripes
  328. -----------
  329.  
  330. The current author and babysitter of this code is:
  331.     Stephen Walton
  332.     Department of Physics and Astronomy
  333.     Cal State Northridge
  334.     18111 Nordhoff St.
  335.     Northridge, CA 91330 USA
  336.     (818) 885-2775
  337.  
  338. E-mail can go to:
  339.     srw@csun.edu (Internet)
  340.  
  341. Thanks and congratulations gratefully accepted;  bug fixes and enhancements
  342. even more so!
  343.  
  344. VII.  Changes
  345. -------------
  346.  
  347. The following changes and improvements have been made to XPR Kermit since
  348. the release of version 1.5:
  349.  
  350. 1. The library is now re-entrant.  This re-entrancy uses a bit of a "trick"
  351.    which depends on the mechanism used by Manx Aztec C to set up small
  352.    model programs.  I have successfully run two simultaneous file
  353.    transfers in XPR Kermit.
  354.  
  355. 2. The timeout code has been improved;  in fact, it appears that it may
  356.    not have worked at all in version 1.5.
  357.  
  358. 3. Block check type 2 did not work in version 1.5.
  359.  
  360. 3. A buffer overflow which could trash the high byte of an address on
  361.    an Amiga 3000 or other 68030-based machine was fixed.  This would
  362.    only be seen, normally, when sending a file with many repeated
  363.    characters.
  364.  
  365. 4. The "Keep incomplete file" feature is new.
  366.  
  367. 5. The file status display has been cleaned up somewhat;  in particular,
  368.    the previous file's final display should no longer show up when a
  369.    new transfer is started.  Timeouts are now counted separately from
  370.    other errors.
  371.  
  372. 6. Local buffers (that is, within XPR Kermit) have been added for both file
  373.    and communication line I/O.  This substantially reduces the number of
  374.    callbacks between XPR Kermit and the comm program, improving performance
  375.    under heavy multitasking. [Note added 3 Dec 1991:  an actual trial
  376.    on the local buffer for serial I/O indicated *worse* performance, so
  377.    the code is only compiled if the symbol MYREAD is #define'd in
  378.    kermitproto.c.  This is not the case in the distributed library.]
  379.  
  380. 7. xpr_chkmisc() and xpr_chkabort() are now called properly.
  381.